// pageB/pageB.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    page:[],
    items:[],
    easy:1.0,
    normal:1.2,
    hard:1.5,
    moneyB:null,
    entertainB:null,
    hungerB:null,
    dayB:null,
  },
  go2(){
    wx.redirectTo({
        url: '/pageC/pageC',
      })
      this.setData({
      NanDu: getApp().globalData.NanDu *= this.data.hard
      })
      console.log(getApp().globalData.NanDu)
  },
  go1(){
    wx.redirectTo({
      url: '/pageC/pageC',
    })
    this.setData({
    NanDu: getApp().globalData.NanDu *= this.data.normal
    })
    console.log(getApp().globalData.NanDu)
  },
  go() {
    wx.redirectTo({
        url: '/pageC/pageC',
      })
      this.setData({
      NanDu: getApp().globalData.NanDu *= this.data.easy
      })
      console.log(getApp().globalData.NanDu)
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let page = getCurrentPages(),arr=[]
    this.setData({
      page:page,
      hungerB:getApp().globalData.hunger=100,
      entertainB:getApp().globalData.yule=50,
      moneyB:getApp().globalData.money=3600,
      dayB:getApp().globalData.day=1
    })
    for(let i=0;i<this.data.page.length;i++){
      var temp = page[i].route.split('/')[0] 
      arr.push(temp);
    }
    this.setData({
      items:arr
    })
    console.log("getApp().globalData.NanDu")
  },
  

 
  onReady: function () {
    console.log("B22222",Date.now())
  },

 
  onShow: function (options) {
    console.log("B33333",Date.now())
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    console.log("BoH",Date.now())
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    this.setData({
      money:getApp().globalData.money /= getApp().globalData.NanDu
      })
    console.log("BuL",Date.now())
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})